import Vue from 'vue'
import App from './App.vue'
import router from './router'
import axios from 'axios'

import * as filters from 'js/filters/filter'
import echarts from 'echarts'

import 'src/assets/styles/index.scss'

// import ECharts from 'vue-echarts/components/ECharts'
// // 导入echarts的图形类型
// import 'echarts/lib/chart/line'
// import 'echarts/lib/chart/bar'
// import 'echarts/lib/chart/pie'
// // 导入工具部分
// import 'echarts/lib/component/tooltip'
// import 'echarts/lib/component/title'
// import 'echarts/lib/component/toolbox'

// Vue.component('chart', ECharts)

Vue.prototype.$axios = axios

axios.defaults.headers.post['Content-Type'] = 'application/json'

// Vue.prototype.$echarts = ECharts

Vue.prototype.$echarts = echarts

Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key])
})

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  render: h => h(App)
})
